package com.hp.tiger.chapter11;

import java.util.concurrent.TimeUnit;

/**
 * @author XavierDong
 **/
public class QueryFromHttpAction {


    public void execute() {

        Context context = ActionContext.getActionContext().getContext();
        String name = context.getName();
        String cardId = getCardId(name);
        context.setCardId(cardId);
    }


    private String getCardId(String name) {
        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        return "232423456546542323" + Thread.currentThread().getId();
    }
}
